#ifndef GAMEPLAYLAYER_H_
#define GAMEPLAYLAYER_H_

#include "cocos2d.h"
#include "SneakyJoystick.h"
#include "SneakyButton.h"
#include "SneakyButtonSkinnedBase.h"
#include "SneakyJoystickSkinnedBase.h"
#include "ScoreLayer.h"
#include "DevilSprite.h"
#include "ControlLayer.h"

using namespace cocos2d;

class GameplayLayer: public cocos2d::CCLayer {
protected:
	CCArray* _angels;
	CCArray* _levels;
public:
	void addPoint();
	virtual ~GameplayLayer();
	static GameplayLayer* node();
	virtual bool init();
	void initJoystickAndButtons();
	void update(float delatTime);
	void renderAngel(float startPointX, float startPointY, float rangeX);
	void moveAngelRevers(CCNode *ang, void* data);
	void moveAngelNormal(CCNode *ang, void* data);
	DevilSprite *devilSprite;
	SneakyJoystick *leftJoystick;
	SneakyButton *jumpButton;
	SneakyButton *attackButton;
	ScoreLayer *scoreLr;
	void setScore(ScoreLayer *scl);
	CREATE_FUNC(GameplayLayer);
	float levelWidht;
	void connectControlsWithJoystick(SneakyJoystick *leftJ,SneakyButton* jumpBtn);
	void addScrollingBackground();
	void adjustLayer();
	void addGameObjects();
	void renderHero();
};

#endif /* GAMEPLAYLAYER_H_ */
